<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%
String realPath = request.getContextPath();   
%>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0 minimal-ui"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>南网图讯-搜索页</title>
    <link type="text/css" href="${ctx}/zenithsun/css/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link type="text/css" href="${ctx }/zenithsun/news/pc/css/basic.css" rel="stylesheet">
    <link type="text/css" href="${ctx }/zenithsun/news/pc/css/index.css" rel="stylesheet">
    <link rel="stylesheet" href="${ctx}/zenithsun/css/admin-imgList.css"/>
    <script type="text/javascript" src="${ctx}/baseNew/plugins/jQuery/jQuery-2.2.0.min.js"></script>
</head>
<body class="j-srcoll">
<!--头部-->
<div class="mod-top j-srcollTop">
    <div class="mod-grid clearfix">
        <div class="mod-left fn-fl">
        	<div class="mod-logo fn-fl"><img src="${ctx}/zenithsun/news/pc/images/login-logo.png" alt=""/></div>
            <div class="mod-search fn-fr">
                <form class="mod-search-grid" method="" action="">
                    <input id="searchValue" onkeypress="javascript:return gosearch();" type="text" class="search-Txt" value="${searchValue}" placeholder="标题，副标题，关键字，摘要，来源"/>
                    <button type="button" class="search-Btn" onclick="doSearch();"><i class="fa fa-search"></i> </button>
                </form>
            </div>
        </div>
        <div class="mod-right fn-fl ml20">
            <div class="mod-downPop-grid fn-fl fn-pr">
                <a href="javascript:void(0);" class="i-downBtn ml20 i-phone">手机客户端下载</a>
                <div class="mod-downPop">
                    <span class="caret"></span>
                    <div class="mod-downCode"><img src="${ctx}/zenithsun/app/appQRCode.png"><p>iPhone & Android</p> </div>
                </div>
            </div>
        </div>
        <h1 class="mod-logo fn-fr mt15" title="南网图讯-图片新闻"><a href="${ctx}/path/newsinfo/index" title="南网图讯-图片新闻"><img src="${ctx}/zenithsun/news/pc/images/main_logo.png" alt="南网图讯"/></a></h1>
    </div>
</div>

<!--内容模块-->
<div class="mainContent mt20 mod-search-content">
    <div class="mod-grid">
        <div id="searchKeyResult" class="mod-sear-keyWord">
        </div>
        <!--主体内容头部-->
        <div class="mc-header">
            <ul id="newsColumnList" class="mc-header-ul clearfix">
                <li><a href="#" onclick="changeColumn(-1);" class="current" id="column-whole">全部</a></li>
            	<c:forEach items="${newsColumns }" var="newscolumn" varStatus="status">
                	<li><a href="#" onclick="changeColumn('${newscolumn.id}');">${newscolumn.name }</a></li>
                </c:forEach>
            </ul>
        </div>
        <!--主体内容-->
        <div class="mc-body clearfix">
            <!--主体内容左边-->
            <div class="mod-resultList" id="newsList">
            </div>
        </div>
    </div>
    <div class="pagnation mb20 pb20 fn-tac" id="pagnation"></div>
</div>

<!--回到顶部模块-->
<div class="mod-grid fn-pr go-top">
    <a href="javascript:void(0);" title="回到顶部">回到顶部</a>
</div>
<!--底部模块-->
<div class="mod-footer">
    <div class="mod-grid clearfix">
        <div class="mod-left fn-tac fn-fl">
            <p class="mod-footer-item"><a href="#" title="关于南网图片新闻网">关于南网图片新闻网</a>|<a href="#" title="服务协议">服务协议</a>|<a href="#" title="隐私政策">隐私政策</a>|<a href="#" title="图片版权">图片版权</a></p>
            <p><a href="#">南方电网传媒有限公司</a> 版权所有　Copyright © 2015 www.csgpic.cn. All rights reserved <a href="#">粤ICP备16079034号</a> </p>
            <p>地址：广东省广州市越秀区东风东路846号　邮编：510600　联系电话：(86－020)38122925　传真：(86－020)38122993/38122992</p>
        </div>
        <div class="mod-right fn-fr">
            <a href="#" class="mod-codeBox">
                <h4>南网图片新闻客户端</h4>
                <img src="${ctx }/zenithsun/app/appQRCode.png" alt=""/>
            </a>
        </div>
    </div>
</div>



<script type="text/javascript" src="${ctx}/zenithsun/news/pc/js/ui.js"></script>
<script type="text/javascript" src="${ctx}/zenithsun/news/pc/js/search.js"></script>
<script type="text/javascript" src="${ctx}/zenithsun/news/pc/js/common.js"></script>
<script>
	var realPath = "${ctx}"; //地址

    $(function () {
    	//判断有没有查询
    	if($('#searchValue') != ""){
    		search(-1);
    	}
    	
        $('#photoCarousel_bottomRoll').IndexCarousel_c({
            switchover: 'bottomRoll',
            time:3000
        });
        //二维码鼠标事件
        $(".mod-downPop-grid").hover(
            function(){
                $(".mod-downPop").stop().animate({height:"150px"}).show();
            },
            function(){
                $(".mod-downPop").stop().animate({height:"0px"}).hide();
            }
        )
        //新闻类型标题点击事件
        $(".mc-header-ul li a").on('click',function(){
            $(".mc-header-ul li a").removeClass("current");
            $(this).addClass("current");
        });
        //为列表模式点击事件
        $(".j-imgListItem-list").on('click',function(){
            $(this).siblings().removeClass("current");
            $(this).addClass("current");
            $(".j-imgList").find("li").attr("data-key","f");
            $(".j-imgList").find(".mod-ListImg-dersc").removeAttr("style");
            $(".j-imgList").removeClass("mod-ListFloat").addClass("mod-ListMenu");
        });
        //为区块模式点击事件
        $(".j-imgListItem-float").on('click',function(){
            $(this).siblings().removeClass("current");
            $(this).addClass("current");
            $(".j-imgList").find("li").attr("data-key","t");
            $(".j-imgList").removeClass("mod-ListMenu").addClass("mod-ListFloat");
        });
      //搜索输入框事件
        $(".search-Txt").focus(function(){
        	$(this).parents(".mod-search").addClass("mod-search-hover");
        });
        $(".search-Txt").blur(function(){
        	$(this).parents(".mod-search").removeClass("mod-search-hover");
        });
        
      //图片异常处理
  	  var imgTags = document.getElementsByTagName("img");
  	  for(var i = 0; i < imgTags.length; i++){
  		  imgTags.item(i).onerror = function(){
  	            this.src = "/csg_pic/zenithsun/news/mobile/images/Default-bg270x180.png";
  	            this.onerror = null;
  	      };
  	  }
      
    })
	var gosearch = function(){
    	if(window.event.keyCode == 13){
   			doSearch();
	        return false;    
	    }
	}
	//点击搜索按钮
	function doSearch(){
    	//设置当前页
    	pageNo = 1; 
    	//设置选中的项目栏
    	$("#newsColumnList li").each(function(index){
    		$("#newsColumnList .current").removeClass("current"); //移除选中
    	});
    	 $("#column-whole").addClass("current"); //添加选中
    	//查询
    	search(-1);
	}
    
    //栏目选择改变事件
    function changeColumn(obj){
    	pageNo = 1; //设置当前页
		search(obj);
    }
    
    
</script>
</body>
</html>